
<script type="text/javascript">

_mSiteName = 'Your Site Name Here!';

_mUsePrintLink="";

function initMap() {
  //
  // frb
  //

  myMapApp = new _MapsApplication(document.getElementById("container_frb"),
				  document.getElementById("panel"),
				  document.getElementById("metapanel"),
				  document.getElementById("permalink"),
				  document.getElementById("toggle"),
				  document.getElementById("printheader"),
				  createMapSpecs());

  myMapApp.loadMap();

  /* Note: All XML & XSL files must be on same domain.
  */
  _loadXmlFileFromURL("xml/demo2.xml", myMapApp);

}

//t.dump = function(a) {alert(a);} //debugging

function _loadXmlFileFromURL(url, mapApp) {
    //
    // Loads the specified external XML file into the map view.
    //
    //  frb
    //
    // NOTE: URL must be on same domain as page.

    var  _getter = _XMLHttp.create();

    _getter.open("GET", url);

    _getter.onreadystatechange=function() {
      if (_getter.readyState==4) {
           mapApp.loadXML(_getter.responseText);
      }
    }

    _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient.
}

      // A function to read the data
      function readMap(url) {
        var url="map11.php?q="+url;
        var request = GXmlHttp.create();
        request.open("GET", url, true);
        request.onreadystatechange = function() {
          if (request.readyState == 4) {
            var xmlDoc = request.responseXML;
            // obtain the array of markers and loop through it
            var markers = xmlDoc.documentElement.getElementsByTagName("marker");

            // hide the info window, otherwise it still stays open where the removed marker used to be
            map.getInfoWindow().hide();

            map.clearOverlays();

            // empty the array
            gmarkers = [];

            // reset the side_bar
            side_bar_html="";

            for (var i = 0; i < markers.length; i++) {
              // obtain the attribues of each marker
              var lat = parseFloat(markers[i].getAttribute("lat"));
              var lng = parseFloat(markers[i].getAttribute("lng"));
              var point = new GLatLng(lat,lng);
              var html = markers[i].getAttribute("html");
              var label = markers[i].getAttribute("label");
              // create the marker
              var marker = createMarker(point,label,html);
              map.addOverlay(marker);
            }
            // put the assembled side_bar_html contents into the side_bar div
            document.getElementById("side_bar").innerHTML = side_bar_html;
          }
        }
        request.send(null);
      }

</script>



<body onload="initMap()">

<!-- Note: Map height always maximum? -->
<div style="border:solid thin grey;">
  <div id="container_frb" style="float:right;width:35%;" ></div>
  <div style="float:left;position:relative;left:10px;width:60%">
    <div style="position:relative;left:0px;top:0px;width:50%;overflow:auto;">
      <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1>

      <p><tt>_MapsApplication({container&nbsp;div}, {panel&nbsp;div}, {metapanel&nbsp;div}, {permalink&nbsp;div}, {toggle&nbsp;div}&nbsp;|&nbsp;null, {printheader&nbsp;div}, {map&nbsp;specs})</tt></p>

      <p><dl>
         <dt style="font-weight:bold;">Container div</dt>

         <dd>The <tt>&lt;div&gt;</tt> where the map should be displayed.</dd>

         <dt style="font-weight:bold;">Panel div</dt>
         <dd>The <tt>&lt;div&gt;</tt> where the "sidepanel" should be displayed.</dd>

         <dt style="font-weight:bold;">Metapanel div</dt>
         <dd>It appears Gmaps uses this to display error and other messages</dd>

         <dt style="font-weight:bold;">Permalink div</dt>
         <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd>

         <dt style="font-weight:bold;">Toggle div</dt>

         <dd>The <tt>&lt;div&gt;</tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd>

         <dt style="font-weight:bold;">Printheader div</dt>
         <dd>Presumably displayed at the head of a printed map.</dd>

	 <dt style="font-weight:bold;">Map specs</dt>

	 <dd>An array of map specifications, just use <tt>createMapSpecs()</tt> here for a quick fix. </dd>
     </dl> </p>

    </div>
    <div style="position:relative;left:50%;top:5px;width:50%;">
    <div id="toggle" style="position:relative;top:0px;left:10px;font-family:sans-serif;font-size:smaller;">&nbsp;</div>
    <div style="position:relative;top:30px;left:5px;">
    <div id="panel" style="height:90%;width:100%;"> </div>
    <div id="metapanel"></div>
    <div id="permalink"></div>
    <div id="printheader"></div>

    </div>
    </div>
  </div>
</div>
<script type="text/javascript">
   initMap();
   </script>
</body>